home *** CD-ROM | disk | FTP | other *** search
- /* PreviewMsg.edge
- ** $VER: PreviewMsg.edge v1.1 (13.01.96)
- ** Original script by Troels Walsted Hansen
- ** An ARexx script that shows you (in THOR's messagetext listview)
- ** what your message will look like when read by others in THOR.
- */
-
- options results
-
- /* needs Edge and THOR functions */
-
- if(substr(address(),1,4) ~= "EDGE") then
- do
- say "This script should only be started from inside Edge."
- exit 20
- end
- else edgeport = address()
-
- p = ' ' || address() || ' ' || show('P',,)
- thorport = pos(' THOR.',p)
-
- if thorport > 0 then thorport = word(substr(p,thorport+1),1)
- else
- do
- say 'No THOR port found!'
- exit 10
- end
-
- /* preview msg text in THOR */
-
- address 'EDGE'
- addressof BW
- address value result
-
- getenvvar _FE_DosName
- old=result
-
- getenvvar _FE_Changes
- oldch=result
-
- SAVEAS 't:PreviewMsg.edge.temp.file'
-
- address(thorport)
- THORTOFRONT
- SHOWTEXT 't:PreviewMsg.edge.temp.file'
- if(rc ~= 0) then REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
-
- /* cleanup and exit */
- address
- putenvvar _FE_DosName old
- putenvvar _FE_Changes oldch
- address command 'delete >nil: t:PreviewMsg.edge.temp.file'
- exit
-